<include file="Public:header" />
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/PCASClass.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/docode.js" type="text/javascript"></script>
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/mxcrm_more.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/daterangepicker/daterangepicker.js"></script>
<!-- Select2 -->
<script src="__PUBLIC__/style/js/plugins/jsTree/jstree.min.js"></script>
<link href="__PUBLIC__/style/css/plugins/jsTree/style.min.css" rel="stylesheet">
<style>
    body{
        overflow-y: hidden;
    }
    .option{padding-left:-30px;}
    #oDivL_tab_Test3{background-color: #fff;}
    .status_ico{
        position: absolute;
        top: -46px;
        background: #FFF;
        border: 1px solid #AAA;
        border-radius: 5px;
        padding: 7px;
        width: 220px;
        display: inline-block;
        display: none;
        left: 50%;
        margin-left: -159px;
        z-index: 101;
    }
    .status_ico:before {
        content: "";
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #AAA;
        position: absolute;
        bottom: -10px;
        left: 100px;
    }
    .status_ico:after{
        content: "";
        width: 0;
        height: 0;
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid #FFF;
        position: absolute;
        bottom: -9px;
        left: 101px;
    }
    .LocalDataUIB{
        margin-left: -4px;
    }
    .LocalDataUIB-input{
        left: 5px;
    }
</style>
<script>
    $(function () {
        var scroll_width = 10;
        $("#table_div").height(window.innerHeight - $("#table_div").offset().top - $("#tfoot_div").height() - parseInt($("#table_container").css("padding-bottom").replace("px", "")) - 10);
        $(window).resize(function () {
            $("#table_div").height(window.innerHeight - $("#table_div").offset().top - $("#tfoot_div").height() - parseInt($("#table_container").css("padding-bottom").replace("px", "")) - 10);
            $("#oDivL_tab_Test3").height($("#table_div").height() - 1).width($("#oTableLH_tab_Test3").width());
            $("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width());
        })
        $(".nicescroll").niceScroll({
            cursorcolor: "#999", //#CC0071 光标颜色
            cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
            touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
            cursorwidth: scroll_width + "px", //像素光标的宽度
            cursorborder: "0", //     游标边框css定义
            cursorborderradius: "3px", //以像素为光标边界半径
            autohidemode: false, //是否隐藏滚动条
            zindex: 100,
            background: "#F3F3F5", //滚动条背景色
        });
        $("#tab_Test3").FrozenTable(1, 0, 3);
        $("#oDivL_tab_Test3").height($("#table_div").height() - scroll_width - 1).width($("#oTableLH_tab_Test3").width()).css({'zIndex': 9});
        $("#oDivL_tab_Test3").css({"background-color": "#fff", "border-right": "1px solid #e7eaec"});
        $("#oTableLH_tab_Test3").css({"border-right": "1px solid #e7eaec"});
        $("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width() - scroll_width).css({'zIndex': 9});

        $("#left_list").height(window.innerHeight - $("#left_list").offset().top - 30);
        $(window).resize(function () {
            $("#left_list").height(window.innerHeight - $("#left_list").offset().top - 30);
        })
    })
</script>
<div style="display:none" id="dialog-log" title="加入项目">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div class="wrapper wrapper-content">
    <include file="Public:alert" />
    <div class="row" >
        <div class="col-md-12">
            <div class="ibox float-e-margins">
                <div class="title-bar" style="position: relative;z-index: 99;">
                    <div class="row  clearfix" id="title-hide" style="display:none;">
                        <ul class="breadcrum pull-left">
                            <li>已选中&nbsp;<span id="icheck_num"></span>&nbsp;项</li>
                            <li>
                            </li>
                            <li class="last_li"><big><a class="fa fa-times pull-right" id="back-show"></a></big></li>
                        </ul>
                    </div>
                    <div class="row " id="title-show" >
                        <a href="javascript:void(0);" onclick="add_return(this)" class="btn btn-primary" style="position: relative;float: right;margin-right: 6%;">新增回款计划</a>
                        <form id="searchForm" class="form-group" method="get" onsubmit="check(this)" style="margin-bottom: 0px;">
                            <input type="hidden" name="m" value="return" />
                            <input type="hidden" name="a" value="index" />
                            <div class="nav pull-left" style="margin:2px 0 0 15px;width: 165px;">
                                <div class="input-group">
                                    <input class="form-control Wdate" input_type="time" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" name="start_time" id="due_time" value="{$Think.get.start_time}
" type="text">
                                </div>
                            </div>
                            <div class="nav pull-left" style="width: 2px;">
                                <div class="input-group" style="margin:10px 2px 2px 2px;">
                                    到
                                </div>
                            </div>
                            <div class="nav pull-left" style="margin:2px 0 0 15px;width: 165px;">
                                <div class="input-group">
                                    <input class="form-control Wdate" input_type="time" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" name="end_time" id="due_time" value="{$Think.get.end_time}" type="text">
                                </div>
                            </div>
                            <div class="nav pull-left" style="margin:2px 0 0 15px;width: 165px;">
                                <div class="input-group">
                                    <select class="form-control select2" style="min-width:165px;max-width: 165px;height: 0px;" name="status" id="department" onchange="changeRole()">
                                        <option class="all" value="-1">回款状态</option>
                                        <option value="1" <if condition="$_GET['status'] eq 1">selected</if> >完成</option>
                                        <option value="0" <if condition="$_GET['status'] eq 0">selected</if> >未完成</option>
                                        <option value="2" <if condition="$_GET['status'] eq 2">selected</if> >逾期未完成</option>
                                    </select>
                                </div>
                            </div>
                            <div class="nav pull-left" style="margin:2px 0 0 15px;width: 200px;">
                                <div class="input-group">
                                    <input id="short_search" style="width:200px;" placeholder="请输入要搜索的项目名称" class="form-control input-sm" name="search_project" value="{$Think.get.search_project}" type="text">
                                </div>
                            </div>
                            <div class="pull-left" style="margin-left: 20px;">
                                <button type="submit" id="analytics_search" class="btn btn-primary">立即搜索</button>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="row" style="margin: 0;" >
                    <div class="pull-left" style="width:16.222%;color: #000;display: none;">
                        <div class="ibox-title clearfix" style="padding-top: 4px;">
                            <div class="detail-title clearfix">
                                <div class="pull-left all-inline" >
                                    <a href="{:U('product/index')}">
                                        <span class="fa fa-inbox" style="font-size:18px;color:#667B8F"></span>
                                        <span style="color:#667B8F">全部人才</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="ibox-content" style="min-height: 300px;border-top: none;">
                            <div id="left_list" class="full-height-scroll">
                                <div id="knowledge-tree" >
                                    {$tree_code}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="pull-right" style="width:100%">
                        <div class="ibox-content clearfix" id="table_container" style="z-index: 1;">
                            <form id="form1" action="" method="Post" style="position:relative;">
                                <div id="table_div" class="nicescroll">
                                    <table class="table table-hover table-striped table_thead_fixed" id="tab_Test3">
                                        <if condition="$plist eq null">
                                            <div style="background-color:#fff;"><include file="Public:nodata" /></div>
                                            <else/>
                                            <tr id="childNodes_num" class="tabTh">
                                                <td style="max-width: 60px;width:74px;padding:0 10px 0 7px;">
                                                    <div class="checkbox checkbox-primary">
                                                        <input type="checkbox" class="check_all"/>
                                                        <label for=""></label>
                                                    </div>
                                                </td>
                                                <td>回款对应项目</td>
                                                <td>计划回款日期</td>
                                                <td>回款期次</td>
                                                <td>计划回款金额</td>
                                                <td>已回款金额</td>
                                                <td>对应客户</td>
                                                <td>回款状态</td>
                                                <td>删除</td>
                                            </tr>
                                            <tbody>
                                            <volist name="plist" id="vo">
                                                <tr class="controls_tr">
                                                    <td>
                                                        <div class="checkbox checkbox-primary">
                                                            <input name="product_id[]" class="check_list" type="checkbox" value="{$vo.business_id}" />
                                                            <label for=""></label>
                                                        </div>
                                                    </td>
                                                    <td data-id=""><a href="javascript:void(0);" onclick="edit_plan('{$vo.business_id}', '{$vo.plan_id}');">{$vo.business}</a></td>
                                                    <td>{$vo.ontime}</td>
                                                    <td>{$vo.nums}</td>
                                                    <td>{$vo.total}</td>
                                                    <td>{$vo.e_total}</td>
                                                    <td>{$vo.customer}</td>
                                                    <td>{$vo.pstatus}</td>
                                                    <td><a href="javascript:void(0);" <if condition="$vo.isdelete eq 0"> onclick="deleteBusiness('{$vo.plan_id}')"<else /> style="color: #777777"</if>>删除</a></td>
                                                </tr>
                                            </volist>
                                            <tbody>
                                        </if>
                                    </table>
                                </div>
                                <div id="tfoot_div" class="clearfix">
                                    <div class="clearfix" id="tfoot_page">
                                        <if condition="$fields_search || $_GET['field']">
                                            <span class="pull-left" style="margin-left:25px;margin-top:10px;">本次搜索结果<span style="color:#F8AC59"> {$count} </span>条数据<a href="{:U('product/index')}" class="btn" style="background:#fff;border:1px solid #ccc;margin-left:10px;color:#999;" id="clearnumber">清除搜索条件</a></span>
                                        </if>
                                        {$page}<include file="Public:listrows" />
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="" style="display:none;" id="dialog-role-info" title="{:L('EMPLOYEE_INFORMATION')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<!-- 模态框 -->
<div class="modal inmodal fade" id="Modal" tabindex="1" style="overflow:auto; border:1px solid #000000;" role="dialog" >
    <div class="modal-dialog modal-md" style="width:1000px;">
        <div class="modal-content" id="dep_modal">

        </div>
    </div>
</div>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet">
<script type="text/javascript">
                                                        /**删除回款项目计划*/
                                                        function deleteBusiness(obj) {
                                                            swal({
                                                                title: "您确定要删除当前回款计划吗？",
                                                                text: "删除后将无法恢复，请谨慎操作！",
                                                                type: "warning",
                                                                showCancelButton: true,
                                                                confirmButtonColor: "#DD6B55",
                                                                confirmButtonText: "是的，我要删除！",
                                                                cancelButtonText: '让我再考虑一下…',
                                                                closeOnConfirm: false,
                                                                closeOnCancel: false
                                                            },
                                                                    function (isConfirm) {
                                                                        if (isConfirm) {
                                                                            $.ajax({
                                                                                url: "/index.php?m=return&a=deletePlan",
                                                                                type: "post",
                                                                                async: true,
                                                                                data: {plan_id: obj},
                                                                                success: function (data) {
                                                                                    if (data.status == 1) {
                                                                                        swal({
                                                                                            title: '删除成功',
                                                                                            text: '您已经永久删除该条信息！',
                                                                                            type: "success",
                                                                                            confirmButtonText: "确定"
                                                                                        }, function (isConfirm) {
                                                                                            if (isConfirm) {
                                                                                                location.reload();
                                                                                            }
                                                                                        });
                                                                                    } else {
                                                                                        swal({
                                                                                            title: "操作失败！",
                                                                                            text: data.info,
                                                                                            type: "error"
                                                                                        })
                                                                                        return false;
                                                                                    }
                                                                                },
                                                                                dataType: 'json'
                                                                            });
                                                                        } else {
                                                                            swal("已取消", "您取消了删除操作！", "error");
                                                                        }
                                                                    });
                                                        }
                                                        /*模态框关闭或打开 先清除内容*/
                                                        $(".modal").on("hide.bs.modal", function () {
                                                            $(this).removeData("bs.modal");
                                                        });
                                                        $(".modal").on("show.bs.modal", function () {
                                                            $(this).removeData("bs.modal");
                                                        });
                                                        /*让复选框默认取消选择*/
                                                        $(':checkbox').prop('checked', false);
                                                        /*增添回款计划*/
                                                        function add_return(obj) {
                                                            $("#dep_modal").parent().removeClass("modal-lg").addClass("modal-md");
                                                            var url = "{:U('return/add_new')}";
                                                            $('#Modal').modal('show');
                                                            $('#dep_modal').load(url);
                                                        }
                                                        /*编辑计划*/
                                                        function edit_plan(obj, obj1) {
                                                            $("#dep_modal").parent().removeClass("modal-lg").addClass("modal-md");
                                                            var url = "{:U('return/edit_plan')}";
                                                            $('#Modal').modal('show');
                                                            $('#dep_modal').load(url + "&plan_id=" + obj + "&plan=" + obj1);
                                                        }
                                                        $(".controls_tr").mouseenter(function () {
                                                            $(this).find(".controls").show();
                                                        }).mouseleave(function () {
                                                            $(this).find(".controls").hide();
                                                        });

                                                        if ("{:C('isMobile')}" == "1") {
                                                            width = $('.container').width() * 0.9;
                                                        } else {
                                                            width = 800;
                                                        }
                                                        
                                                        function check(){

                                                        }
                                                        function datedifference(sDate1, sDate2) {    //sDate1和sDate2是2006-12-18格式  
                                                            var dateSpan, tempDate, iDays;
                                                            sDate1 = Date.parse(sDate1);
                                                            sDate2 = Date.parse(sDate2);
                                                            dateSpan = sDate2 - sDate1;
                                                            dateSpan = Math.abs(dateSpan);
                                                            iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
                                                            return iDays
                                                        }
                                                        ;

                                                        $(".select2").select2();
</script>
<include file="Public:footer" />
<div id="right-sidebar-log">
    <!--the css for jquery.mCustomScrollbar-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
    <!--the css for this plugin-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
    <!--(Optional) the js for jquery.mCustomScrollbar's addon-->
    <script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
    <!--the js for jquery.mCustomScrollbar-->
    <script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
    <!--the js for this plugin-->
    <script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>

    <div class="sidebar-container" id="sidebar-container">

    </div>
</div>
<style>
    .slimScrollDiv{
        overflow: inherit !important;
    }

    .sidebar-container ul.nav-tabs li a{
        background: #fff !important;
        color: #a7b1c2 !important;
        font-weight: 600 !important;
        padding: 14px 20px 14px !important;
        border-right: none !important;
    }
    .sidebar-container nav{
        display: none;
    }
    .sidebar-container #page-wrapper{
        margin-left: 0px;
    }
    #sidebar-container{
        box-shadow: rgb(187, 187, 187) -1px 10px 10px;
        border: 2px solid rgb(238, 238, 238);
    }

    #right-sidebar-log{
        width: 60%;
        right: -60%;
        background-color: #fff;
        position: fixed;
        top: 60px;
        z-index: 1009;
        bottom: 0;
        box-shadow: -5px -5px 1px #ccc;
    }

</style>
